home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu332 / 332equ.arc / 332RAM.EQU < prev    next >
Text File  |  1990-03-12  |  7KB  |  128 lines

  1.  
  2. ****************************************************************************
  3. * $RCSfile: 332ram.equ $
  4. * $Revision: 1.1 $
  5. * $Date: 90/03/12 13:45:26 $
  6. *
  7. *       -------------------------------------------------------------
  8. *       Module Name:        332RAM - MC68332 RAM Registers
  9. *       -------------------------------------------------------------
  10. *
  11. *       Description:
  12. *          1. This file contains EQUates for all the Standby RAM
  13. *             Module (RAM) registers and bits for the MC68332.  Consult
  14. *             the "MC68332 System Integration Module User's Manual", part
  15. *             number SIM32UM/AD, for more details.
  16. *          2. A 64-byte address space is reserved for the RAM, though not
  17. *             all are used.
  18. *          3. The ABSOLUTE address area where the register array block
  19. *             appears in memory is specified by the value of REG$, which
  20. *             should be defined in the user's system definitions.  The
  21. *             value of REG$ is $YFF000, where Y = M111 and M reflects the
  22. *             modmap bit (MM) in the module configuration register (MCR).
  23. *
  24. *                   REG$ value    Comments
  25. *                   ----------    ---------------------------------
  26. *                   $007FF000     MCR MM bit = 0
  27. *                   $00FFF000     MCR MM bit = 1   (reset default)
  28. *                   $FFFFF000     MCR MM bit = 1   (reset default)
  29. *                                   Forces short addressing (unused 
  30. *                                   upper address lines are ignored)
  31. *          4. The following pages summarize these registers and their
  32. *             associated addresses.
  33. *
  34. *       Notes:
  35. *          1. Motorola reserves the right to make changes to this file.
  36. *             Although this file has been carefully reviewed and is
  37. *             believed to be reliable, Motorola does not assume any
  38. *             liability arising out of its use.  This code may be freely
  39. *             used and/or modified at no cost or obligation to the user.
  40. *          2. All descriptions are WORD values unless stated otherwise.
  41. *          3. The DEF macro along with the BIT$CODE symbol controls the
  42. *             actual bit definitions.  See the DEF macro in the DEF.MAC
  43. *             file for details.
  44. *          4. This file was made for use with the Motorola Development
  45. *             Systems M68000 Family Structured Assembler for MS-DOS,
  46. *             known as M68MASM.
  47. *          5. To use this file, either use an INCLUDE statement or just
  48. *             merge this file into your source code file.  Consult your
  49. *             assembler's user's manual for the details specific to your
  50. *             situation.  Reference the code segment example below for
  51. *             usage ideas (shown in M68MASM for MS-DOS syntax).
  52. *
  53. *             REG$     EQU      $FFFFF000         Register base address
  54. *             * NOTE: A31-24 unused in MC68332, so we set them all =1
  55. *             *       in order to use absolute short addressing mode!
  56. *                      NOLIST
  57. *                      INCLUDE  "DEF.MAC"
  58. *                      INCLUDE  "332RAM.EQU"
  59. *                      LIST
  60. *             START    CLR      RAM$+RAMTST       Absolute addressing!
  61. *                      LEA      RAM$,A6           .      OR
  62. *                      CLR      (RAMTST,A6)       Indexed addressing!
  63. *             *    Bit number usage w/indexing!
  64. *                      BCLR.B   #.RAMDS,(RAMBAR+1,A6)
  65. *                      OR.W     (1<<.STOP)+(1<<.RASP),(RAMMCR,A6)
  66. *             *                                   .      OR
  67. *             *    Bit value usage w/indexing!
  68. *                      AND.W    #(-_RAMDS-1)&$FFFF,(RAMBAR,A6)
  69. *                      OR.W     _STOP+_RASP,(RAMMCR,A6)
  70. *             *    Bit field usage w/indexing!
  71. *                      MOVE.B   #(20*SDTEST_),(RAMTST,A6)
  72. *             *    Bit field mask usage w/indexing!
  73. *                      MOVE.W   (RAMTST,A6),D0
  74. *                      MOVE.W   D0,D1
  75. *                      AND.W    #SDTEST_MSK,D0   Isolate SDTEST field
  76. *                      MOVE.L   #.SDTEST,D2
  77. *                      LSR.W    D2,d0            and right justify it!
  78. *                      AND.W    #SDTEST_NMSK,D1  Clear SDTEST field.
  79. *
  80. *             For bit fields, a value (0-N) will be placed inside.  As
  81. *             can be seen in the last line above, this is accomplished
  82. *             by multiplying the bit field label by the desired value
  83. *             for the field.  This line initializes the RAMTST register
  84. *             which has one bit field, SDTEST.  This field is initial-
  85. *             ized to 20 by this line (places a value of $2800 into the
  86. *             RAMTST register).
  87. *          6. Be careful when using any of the BIT instructions (BCHG,
  88. *             BCLR, BSET, BTST), as they will only operate on a BYTE of
  89. *             memory, not a WORD.  Thus to access a bit in the least
  90. *             significant half of a word sized register (B0-B7), "+1"
  91. *             must be added to the operand address.  See the code
  92. *             segment example in item 5 above.
  93. *          7. Because the equate files can generate many listing pages,
  94. *             the user may wish to disable the listing via NOLIST and
  95. *             LIST directives as seen in the above example code.
  96. *          8. The latest version of this file is maintained on the
  97. *             Motorola FREEWARE Bulletin Board, 512/891-FREE (512/891-
  98. *             3733).  It operates continuously (except for maintenance)
  99. *             at 1200-2400 baud, 8-bits, no parity.  Download the
  100. *             archive file 332EQU.ARC to get all the files.
  101. *
  102. ****************************************************************************
  103.  
  104.  
  105. *********************************************************************
  106. * Define Module Base Address
  107. *********************************************************************
  108. RAM$    EQU     REG$+$B00    RAM base address
  109.  
  110. *********************************************************************
  111. * Define Registers and Bits
  112. *********************************************************************
  113. RAMMCR  EQU     $000         RAM Module Configuration Register
  114.         DEF     STOP,B15     . stop control
  115.         DEF     RASP,B8      . RAM array space
  116. *-------------------------------------------------------------------*
  117. RAMTST  EQU     $002         RAM Test Register
  118.         DEF     SDTEST,B9,7  . soft detect test function     (7 bits)
  119.         DEF     RTBA,B8      . base address register R/W
  120. *-------------------------------------------------------------------*
  121. RAMBAR  EQU     $004         RAM Array Base Address/Status Register
  122. * NOTE:  RAMBAR is a WRITE-ONCE register!
  123.         DEF     RAMBAS,B3,13 . RAM array base addr, A23-A11 (13 bits)
  124.         DEF     RAMDS,B0     . RAM array disable
  125. *-------------------------------------------------------------------*
  126. *UNUSED EQU     $006-$03F    Unused positions
  127. *********************************************************************
  128.